package com.myblog.controller;

import com.myblog.Utils.RedisCache;
import com.myblog.annotation.Log;
import com.myblog.domain.GlobalResponse;
import com.myblog.domain.entity.LoginUser;
import com.myblog.domain.entity.User;
import com.myblog.services.LogoutService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api(tags = "登出控制器")
public class LogoutController {

    @Resource
    LogoutService logoutService;


    @PostMapping("/logout")
    @Log(BusinessName = "登出")
    @ApiOperation(value = "登出")
    public GlobalResponse logout(){
        return logoutService.logout();
    }
}
